import request from '@/utils/request'

// 查询药物列表
export function getZskDrugsList(query) {
  return request({
    url: '/gene-face/drug/getDrugsList',
    method: 'get',
    params: query
  })
}

export function dictDrugSearch(query) {
  return request({
    url: '/gene-face/drug/search',
    method: 'get',
    params: query
  })
}

export function geneSearch(data) {
  return request({
    url: '/gene-face/gene/search',
    method: 'post',
    data: data
  })
}

export function adrSearchDetail(adrID) {
  return request({
    url: '/gene-face/adr/searchDetail',
    method: 'get',
    params: adrID
  })
}

export function adrGeneDetail(data) {
  return request({
    url: '/gene-face/gene/listGenesByUUID',
    method: 'get',
    params: data
  })
}

// export function adrSearch(data) {
//   return request({
//     url: '/gene-face/adr/search',
//     method: 'post',
//     data: data
//   })
// }

export function adrSearch(data) {
  return request({
    url: '/gene-face/adr/selectDrugs',
    method: 'post',
    data: data
  })
}

export function getZskGeneDetailList(gene) {
  return request({
    url: '/gene-face/gene/listByGene',
    method: 'get',
    params: gene
  })
}

export function getZskGeneDetail(gene) {
  return request({
    url: '/gene-face/gene/getGeneInterpretationDetail',
    method: 'get',
    params: gene
  })
}

// 药品信息编辑
export function updateZskDrugsList(data) {
  return request({
    url: '/gene-face/drug',
    method: 'put',
    data: data
  })
}

// 药品添加
export function addZskDrugs(data) {
  return request({
    url: '/gene-face/drug',
    method: 'post',
    params: data
  })
}

// 删除药品
export function deleteDruyById(id) {
  return request({
    url: '/gene-face/drug/' + id,
    method: 'delete'
  })
}

// 查询20条药品
export function selectDrueyListTwo() {
  return request({
    url: '/gene-face/drug/list',
    method: 'get'

  })
}

// 基因添加
export function addZskGenes(data) {
  return request({
    url: '/gene-face/gene',
    method: 'post',
    params: data
  })
}

// 基因信息编辑
export function updateZskGenes(data) {
  return request({
    url: '/gene-face/gene',
    method: 'put',
    params: data
  })
}

// 删除基因
export function deleteGeneById(id) {
  return request({
    url: '/gene-face/gene/' + id,
    method: 'delete'

  })
}

export function selectZskDrugs(data) {
  return request({
    url: '/gene-face/drug/selectZskDrugs',
    method: 'post',
    params: data
  })
}

export function getZskDictDrugsByUUID(uuid) {
  return request({
    url: '/gene-face/zskDictDrugs/' + uuid,
    method: 'get'
  })
}

// 获取药物中文名
export function getZskDictDrugsCnname() {
  return request({
    url: '/gene-face/zskDictDrugs/list',
    method: 'get'
  })
}

// 获取全部配置药物
export function getAllDictDrugs() {
  return request({
    url: '/gene-face/zskDictDrugs/allDictDrugs',
    method: 'get'
  })
}

// 获取药物目录
export function selectZskDictDrugsList(params) {
  return request({
    url: '/gene-face/zskDictDrugs/selectZskDictDrugsList',
    method: 'get',
    params: params
  })
}

export function getDrugGuideById(id) {
  return request({
    url: '/gene-face/drug/guide/' + id,
    method: 'get'
  })
}

export function getDrugInteractionById(id, query) {
  return request({
    url: '/gene-face/drug/interaction/' + id,
    method: 'get',
    params: query
  })
}

export function getDrugGeneById(id, query) {
  return request({
    url: '/gene-face/drug/gene/' + id,
    method: 'get',
    params: query
  })
}

export function getGeneEffectList(uuid) {
  return request({
    url: '/gene-face/drug/geneDrugEffect/' + uuid,
    method: 'get'
  })
}

export function getAdverseReactions(query) {
  return request({
    url: '/gene-face/gene/adverseReactions',
    method: 'get',
    params: query
  })
}

export function getGenesDrugsById(data) {
  return request({
    url: '/gene-face/drug/guideListByGene',
    method: 'get',
    params: data
  })
}

export function downloadDrugFile(query) {
  var headers = {}
  headers.isToken = false;
  return request({
    url: '/gene-face/pdf',
    method: 'get',
    params: query,
    responseType: 'blob',
    headers: headers
  })
}

export function getGeneFrequencyType(query) {
  return request({
    url: '/gene-face/zskGeneFrequency/geneFrequencyType',
    method: 'get',
    params: query
  })
}

export function getGeneFrequencyList(query) {
  return request({
    url: '/gene-face/zskGeneFrequency/geneFrequency',
    method: 'get',
    params: query
  })
}

export function getZskGkbClinicalAnnMetadataList(query) {
  return request({
    url: '/gene-face/zskGkbClinicalAnnMetadata/zskGkbClinicalAnnMetadataList',
    method: 'get',
    params: query
  })
}

export function getGeneDetail(query) {
  return request({
    url: '/gene-face/gene/geneDetail',
    method: 'get',
    params: query
  })
}

export function getDrugById(id) {
  return request({
    url: '/gene-face/drug/' + id,
    method: 'get'
  })
}

export function getZskDrugsNameList(query) {
  return request({
    url: '/gene-face/zskDrugsName/list',
    method: 'get',
    params: query
  })
}

// //批量修改drug
//   export function batchEditDrug(data) {
//     return request({
//       url: '/gene-face/batchEditDrug',
//       method: 'post',
//       params: data
//     })
// }
